<template>
	<view>
		<view class="mainpadding_top ffffff">
			<view class="flexbetween">
				<view class="shilitu margin_right2">
					<image :src="dataAll.image_text" mode=""></image>
				</view>
				<view class="flexcolumn"
					style="width: 69%;align-items: flex-start;height: 160rpx;justify-content: space-between;">
					<view class="titletext xiaohei fonweight yhxk">{{dataAll.name}}</view>
					<view class="flexleft">
						<view class="sanshier xiaohong fonweight">￥{{dataAll.pay_price}}</view>
					</view>
				</view>
			</view>
		</view>
		<view class="mainpadding_top ffffff">
			<view class="flexleft xiahuaxian">
				<view class="strongtext margin_right">剩余课数：</view>
				<view class="strongtext">{{dataAll.sy_num}}节课</view>
			</view>
			<view class="flexleft xiahuaxian margin_top">
				<view class="strongtext margin_right">退款金额：</view>
				<view class="strongtext" style="color: #1ba95b;">￥{{dataAll.pay_price}}元</view>
			</view>
			<!-- <view class="flexleft xiahuaxian margin_top">
				<view class="strongtext margin_right">退款方式：</view>
				<view class="strongtext">原路返回</view>
			</view> -->
		</view>
		<view class="mainpadding gudingdb">
			<view class="bigbtn" @click="submit()">确认</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				listid: "",
				dataAll: {},
				pageShow: false,
			}
		},
		onLoad(options) {
			this.listid = options.id
		},
		onShow() {
			this.getDetail()
		},
		methods: {
			submit(){
				httpRequest.request('/api/user/cgReturnPrice', 'GET', {
					id: this.listid
				}, false, false, true).then(res => {
					httpRequest.toast(res.msg)
					if (res.code == 1) {
						setTimeout(()=>{
							uni.navigateBack(1)
						},1000)
					}
				})
			},
			getDetail() {
				httpRequest.request('/api/user/cgOrderDetail', 'GET', {
					id: this.listid
				}, false, false, true).then(res => {
					this.dataAll = res.data
					this.pageShow = true
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	page {
		background-color: #f9f9f9;
	}

	.shilitu {
		width: 200rpx;
		height: 160rpx;

		image {
			width: 100%;
			height: 100%;
		}
	}
</style>